package com.yanqu.road.entity.log;

import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Date;

@FieldTypeAnnotation(tableName = "t_l_subscribe", autoSave = true)
public class LogSubscribe {

    @FieldTypeAnnotation(isIndex = true)
    private long userId;

    @FieldTypeAnnotation(desc = "商品编号")
    private int mallId;

    @FieldTypeAnnotation(desc = "类型，0：新订阅；1：续订；2：取消")
    private int type;

    @FieldTypeAnnotation(desc = "订单号")
    private String orderNo;

    @FieldTypeAnnotation(desc = "sdk订单号")
    private String sdkOrderNo;

    @FieldTypeAnnotation(desc = "是否试用")
    private boolean isFree;

    @FieldTypeAnnotation(desc = "到期时间")
    private long expiresTime;

    @FieldTypeAnnotation(desc = "时间")
    private Date logTime;

    public LogSubscribe(long userId, int mallId, int type, String orderNo, String sdkOrderNo, boolean isFree, long expiresTime) {
        this.userId = userId;
        this.mallId = mallId;
        this.type = type;
        this.orderNo = orderNo;
        this.sdkOrderNo = sdkOrderNo;
        this.isFree = isFree;
        this.expiresTime = expiresTime;
        logTime = new Date();
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getMallId() {
        return mallId;
    }

    public void setMallId(int mallId) {
        this.mallId = mallId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getSdkOrderNo() {
        return sdkOrderNo;
    }

    public void setSdkOrderNo(String sdkOrderNo) {
        this.sdkOrderNo = sdkOrderNo;
    }

    public boolean isFree() {
        return isFree;
    }

    public void setFree(boolean free) {
        isFree = free;
    }

    public long getExpiresTime() {
        return expiresTime;
    }

    public void setExpiresTime(long expiresTime) {
        this.expiresTime = expiresTime;
    }

    public Date getLogTime() {
        return logTime;
    }

    public void setLogTime(Date logTime) {
        this.logTime = logTime;
    }
}
